<?php 

include "connect.php";

session_start();

include "check_login.php";

$query = "SELECT * FROM users WHERE id = $customer_id";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
	
	{
    $customer_name = $row['username'];
    }



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link href="css/header.css" rel="stylesheet" type="text/css">
<link href="css/navigation.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-image: url(images/wood.jpg);
	background-repeat: repeat-x;
	margin: 0px;
	background-position: left top;
	background-attachment: fixed;
	background-color: #000000;
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
}
</style>
<link href="css/customer_account.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="page_container">

<?php 

include "header.php"; 

include "navigation.php";

?>

<div id="account_container">

<h1><b>Welcome to your account: </b><?php echo $customer_name; ?><b> Your account ID: </b><?php echo $customer_id ?></h1>


<div id="alert_contaner">

<h2>Your alerts</h2>

<?php

$query = "SELECT * FROM customer_accounts WHERE customer_id = $customer_id";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
	
	{
    $customer_name = $row['customer_forname'];
    }




$query = 


"SELECT * 

FROM saddles 

LEFT JOIN customer_alerts 

ON saddles.id = customer_alerts.product_id 

WHERE customer_id = $customer_id";

$result = mysql_query($query);

while($row = mysql_fetch_array($result))
	
	{
		
    echo "<ul>";
	echo "<li class='".$row['product_status']."'>";
	echo '<img class="alert_image" src="images/saddles/1_1.jpg" width="500" height="500" />';
	echo "<p><b>".$row['product_status']." - </b>".$row['product_name']."</p>";
	echo 
	'
	
	<form action="remove_alertlist.php" method="post" name="remove_alert">
	<input name="product_id" type="hidden" value="'.$row['product_id'].'" />
	<input name="customer_id" type="hidden" value="<?php echo $customer_id ?>" />
	<input id="remove_alert_button" name="Remove" type="submit" value="Remove alert" />
	</form>
	
	<form action="product_details.php" method="post" name="remove_alert">
	<input name="product_id" type="hidden" value="'.$row['product_id'].'" />
	<input id="remove_alert_button" name="Product details" type="submit" value="Product details" />
	</form>
	';
    echo "<br />";
	echo "</li>";
	echo "</ul>";
	}



?>


</div>
<!--wishlist_contaner-->

<a href="customer_logout.php">Logout</a>

</div>
<!--account_container-->

</div> 
<!--page_container-->

<?php include "footer.php" ?>

</body>
</html>